package org.itboys.store.entity;

import org.itboys.mongodb.entity.BaseLongIdEntity;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Index;
import org.mongodb.morphia.annotations.Indexed;
import org.mongodb.morphia.annotations.Indexes;

/**
 * Created by huml on 2016/5/19.
 * 购物车实体
 */
@Entity(value = "StoreCarItem", noClassnameStored = true)
@Indexes(value = {
        @Index(name="memberAndProduct",value="memberId, productId")
})
public class CarItem extends BaseLongIdEntity{

    private static final long serialVersionUID = -4576356298348745831L;

    @Indexed
    private Long memberId;//会员id
    private Long productId;//产品id
    private String productName;//产品名称
    private String productImage;//产品主图
    private int num = 1;//数量
    private double price;//单价
    private double totalFee;//总价
    private String storage;//仓库

    private Integer type;//产品是海淘还是积分

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getProductImage() {
        return productImage;
    }

    public void setProductImage(String productImage) {
        this.productImage = productImage;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getTotalFee() {
        return totalFee;
    }

    public void setTotalFee(double totalFee) {
        this.totalFee = totalFee;
    }

    public String getStorage() {
        return storage;
    }

    public void setStorage(String storage) {
        this.storage = storage;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }
}
